home *** CD-ROM | disk | FTP | other *** search
Makefile | 1992-10-05 | 4.2 KB | 149 lines |
- #
- # Makefile for MiNT using the LCC
- #
- #for 16 bit integers ONLY
- MODEL = -w -b0 -r0 -bn -aw
- LIBS =
- DEFS = -DFASTTEXT -DOWN_LIB
- SYMS = -Hmint.sym
- OPTS = -d1 -Oloop -v -cfs -cag
-
- # 30 - pointers do not point to same type of object
- # 86 - formal definitions conflict with type list
- # 100 - no prototype declared for function
- # 104 - conversion from pointer to const/volatile to pointer to non-const/volatile
- # 135 - assignment to shorter data type (precision may be lost)
- # 154 - no prototype declared for function pointer
- # 159 - use of unary minus on unsigned value
- ERRORS = -j30e86e100e104e135i154e159i
-
- CC = lcc
- COPTS = $(OPTS) $(MODEL) $(DEFS) $(ERRORS)
- CFLAGS = $(COPTS) $(SYMS)
- ASFLAGS = -ma -m8 -.
- LDFLAGS = -t=
-
- COBJS = main.o bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o \
- dossig.o filesys.o mem.o proc.o signal.o timeout.o tty.o util.o \
- biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
- unifs.o shmfs.o fasttext.o
-
- CSRCS = main.c bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c \
- dossig.c filesys.c mem.c proc.c signal.c timeout.c tty.c util.c \
- biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
- unifs.c shmfs.c fasttext.c
-
- SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
- SPPSRCS = context.spp intr.spp syscall.spp quickzer.spp quickmov.spp cpu.spp
- SSRCS = context.s intr.s syscall.s quickzer.s quickmov.s cpu.s
-
- OBJS = $(COBJS) $(SOBJS)
-
- mint.prg: $(OBJS)
- $(CC) $(CFLAGS) -o mint.prg $(LDFLAGS) $(OBJS) $(LIBS)
-
- $(COBJS): mint.sym
-
- main.o: version.h
-
- mint.sym: mint.h ctype.h assert.h atarierr.h basepage.h types.h \
- signal.h mem.h proc.h file.h sproto.h proto.h inline.h
- $(CC) $(COPTS) -ph -o mint.sym mint.h
-
- #
- # assembler source files are now handled in a radically different
- # fashion. We build a pre-processor program, asmtrans, that
- # takes the .spp files, merges them with an include file that
- # gives various offsets into structures of interest, and produces
- # the .s files as output. This has two major advantages:
- # (1) it lets us use the same source for both the Lattice and
- # gcc assembler files (the translator will convert), and
- # (2) if we change the CONTEXT or PROC structures, we don't
- # have to dig through the source code looking for
- # magic numbers
-
- # the asm translator program
-
- ATRANSOBJ = asmtab.o trutil.o trans.o
- ATRANS = asmtrans.ttp
-
- # to build $(ATRANS) we re-run the makefile, overriding SYMS (since the
- # precompiled headers disagree with the Standard C library), ERRORS (since
- # the bison parser is some of the dirtiest code ever), and OPTS (because
- # alloca() and the optimiser are a no-no).
- atrans:
- $(MAKE) -f makefile.lcc SYMS= ERRORS= OPTS= asmtrans.ttp
- .PHONY: atrans
-
- $(ATRANS): $(ATRANSOBJ)
- $(CC) $(CFLAGS) -o $(ATRANS) $(ATRANSOBJ)
-
- #
- # depending on your version of bison/yacc, you may
- # need to change these names
- YACC = bison -d
- YTABC = asm,tab.c
- YTABH = asm,tab.h
-
- asmtab.c asmtab.h: asm.y
- $(YACC) asm.y
- mv $(YTABC) asmtab.c
- mv $(YTABH) asmtab.h
-
- # the magic number include file is generated automagically
-
- genmagic.ttp: genmagic.c mint.sym
- $(CC) $(CFLAGS) -DGENMAGIC -o genmagic.ttp genmagic.c
-
- magic.i: genmagic.ttp
- genmagic magic.i
-
- #
- # assembler source files
- #
- .SUFFIXES: .spp
-
- .spp.o:
- $(ATRANS) -asm -o $*.s $<
- $(AS) $(ASFLAGS) -o$@ $*.s
- $(RM) $*.s
-
- .spp.s:
- $(ATRANS) -asm -o $@ $<
-
- context.spp intr.spp syscall.spp: magic.i
-
- $(SPPSRCS): atrans
-
- #
- # A phony target to build the .S files for use by MINTLC.PRJ
- #
- ssrcs: $(SSRCS)
- .PHONY: ssrcs
-
- #
- # For building proto.h using Lattice we use the compiler option to
- # generate them for external functions only. We also ask it to protect
- # the prototypes with __PROTO; we could then sed __PROTO references into
- # P_ ones (but don't at the moment).
- #
- # This is more trouble than its worth, lets forget it for know (lets be
- # honest editting proto.h by hand is usually easier...)
- #proto.h: $(CSRCS)
- # $(CC) -pep $(CFLAGS) $(CSRCS)
- # cat $(CSRCS:.c=.i) >proto.h
- # rm $(CSRCS:.c=.i)
-
- #
- # macros for cleaning up
- #
- GENFILES= $(OBJS) $(ATRANSOBJ) magic.i $(ATRANS) genmagic.ttp genmagic.o \
- mint.sym $(SSRCS)
- EXTRAS= asmtab.c asmtab.h mint.prg
-
- clean:
- $(RM) $(GENFILES)
-
- realclean:
- $(RM) $(GENFILES) $(EXTRAS)
-